function formFillForOrderInfo(orderMenuNo,theForm){
    $.ajax({
       type:"GET",
       data:"orderMenuVO.id=" + orderMenuNo,
       url:"findOrderInfo.action",
       async: false,
       success: function(result){
         var orderMenuObj = strToJson(result);
         theForm.form.findField("orderNo").setValue(orderMenuNo);
         theForm.form.findField("buyerName").setValue(orderMenuObj[0].buyerName);
         theForm.form.findField("buyerAddress").setValue(orderMenuObj[0].buyerAddress);
         theForm.form.findField("buyerPhone").setValue(orderMenuObj[0].buyerPhone);
         theForm.form.findField("buyerEmail").setValue(orderMenuObj[0].buyerEmail);
         createOrderInfoGrd(orderMenuNo);
       }
    });
}
//创建订单信息表格
function createOrderInfoGrd(orderMenuNo){
  var columns = [
       new Ext.grid.RowNumberer(),
      {header:"goodsId",dataIndex:"id",hidden: true},
      {header:"cms.td.header.goodsName",dataIndex:"goodsName",align:"center"},
      {header:"cms.td.header.goodsPrice",dataIndex:"goodsPrice",width: 80,align:"center"},
      {header:"cms.td.header.unit",dataIndex:"goodsPriceUnit",width:40,sortable: false,align:"center"},
      {header:"cms.td.header.goodsPic",dataIndex:"goodsPic",renderer:renderGoodsPic2,width:120,align:"center"},
      {header:"cms.td.header.goodsBuyCount",dataIndex:"goodsCount",width:80,align:"center"},
      {header:"cms.td.header.totalPrice",dataIndex:"totalPrice",width:80,align:"center"}
  ];
   i18nColM(columns);
   var colM = new Ext.grid.ColumnModel(columns);
   var tableObj = {};
   tableObj.height = 170;
   tableObj.width = 800;
   tableObj.colM = colM;
   tableObj.fields = ["id","goodsPic","goodsName","goodsRestCount","goodsPrice","goodsPriceUnit","goodsCount","operation","totalPrice","deleteOperation"];
   tableObj.gridId = "orderDataGrd";
   tableObj.title = "";
   tableObj.verticalAlign = true;
   tableObj.pageSize = 2;
   $.splitPage(tableObj,"findOrderInfoGrdData.action?param1=" + orderMenuNo);
 
   
}

//对商品图片路径进行渲染
function renderGoodsPic2(value){
  var imgObj = "<img src='" + value + "'" + " width='50px' height='50px' style='border: 1px solid #ccc;cursor: pointer'/>";
  return imgObj;
}




//创建订单信息，主要用来显示订单号，购买人联系地址、联系电话等信息。
function createOrderInfo(orderNo){
    var formPanel = new Ext.FormPanel({
        renderTo:"orderInfoDiv",
        title:"订单信息",
        hideLabels:false,
        labelAlign:"right",
        inputAlign:"left",
        height: 240,
        width: 800,
        defaultType:"textfield",
        
        items:[
        {
           fieldLabel:"编号",
           name:"orderNo",
           style:"margin-top: 5px;width: 650px;",
           labelStyle:"margin-top: 5px;",
           disabled:true
         },
         {
           fieldLabel:"姓名",
           name:"buyerName",
           style:"margin-top: 5px;width: 650px;",
           labelStyle:"margin-top: 5px;",
           disabled:true
         },
         {
           fieldLabel:"地址",
           name:"buyerAddress",
           style:"margin-top: 5px;width:650px",
           xtype:"textarea",
           labelStyle:"margin-top: 5px",
           disabled: true
         },
         {
           fieldLabel:"电话",
           name:"buyerPhone",
           style:"margin-top:5px;width:650px",
           labelStyle:"margin-top: 5px",
           disabled: true
         },
         
         {
           fieldLabel:"Email",
           name:"buyerEmail",
           style:"margin-top:5px;width:650px",
           labelStyle:"margin-top: 5px",
           disabled: true
         }
         
        ]
    });
    formFillForOrderInfo(orderNo,formPanel);
}

